<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property string $uid
 * @property string $username
 * @property string $password
 * @property string $salt
 * @property integer $gender
 * @property string $avatar
 * @property string $mobile
 * @property string $province
 * @property string $city
 * @property string $register_time
 * @property string $register_ip
 * @property integer $status
 * @property integer $platform
 * @property integer $channel
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['gender', 'province', 'city', 'register_time', 'status', 'platform', 'channel'], 'integer'],
            [['username', 'register_ip'], 'string', 'max' => 15],
            [['password'], 'string', 'max' => 32],
            [['salt'], 'string', 'max' => 4],
            [['avatar'], 'string', 'max' => 255],
            [['mobile'], 'string', 'max' => 11]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'uid' => 'Uid',
            'username' => 'Username',
            'password' => 'Password',
            'salt' => 'Salt',
            'gender' => 'Gender',
            'avatar' => 'Avatar',
            'mobile' => 'Mobile',
            'province' => 'Province',
            'city' => 'City',
            'register_time' => 'Register Time',
            'register_ip' => 'Register Ip',
            'status' => 'Status',
            'platform' => 'Platform',
            'channel' => 'Channel',
        ];
    }
}
